package com.example.demo;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.widget.TextView;

public class EndGameActivity extends Activity {
	static final String TAG = EndGameActivity.class.getName();

	TextView tvScore;
	TextView tvhs;
	TextView tvSize;
	TextView tvCount;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_end_game);

		Log.d(TAG, this.getIntent().getExtras().get("score").toString());
		Log.d(TAG, this.getIntent().getExtras().get("count").toString());
		Log.d(TAG, this.getIntent().getExtras().get("size").toString());
		Log.d(TAG, ((ApplicationDemo) getApplication()).getHigtScore().toString());
		
				
		tvScore = (TextView) findViewById(R.id.tvScore);
		tvhs = (TextView) findViewById(R.id.tvHightScore);
		tvSize = (TextView) findViewById(R.id.tvSize);
		tvCount = (TextView) findViewById(R.id.tvCount);
		
		Double hightSocre = ((ApplicationDemo) getApplication()).getHigtScore();
		
		tvCount.setText("Cantidad de Frutas:"+this.getIntent().getExtras().get("count").toString());
		tvSize.setText("Tamaño del Gusano:"+this.getIntent().getExtras().get("size").toString());
		tvhs.setText("Puntaje Maximo:"+hightSocre.toString());
		tvScore.setText("Puntaje:"+this.getIntent().getExtras().get("score").toString());
		
		((ApplicationDemo) getApplication()).getGame().resetGame();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.end_game, menu);
		return true;
	}

}
